package com.zhongyu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongyu.pojo.RolePermission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RolePermissionMapper extends BaseMapper<RolePermission> {

    //根据角色id查询该角色id对应的权限id有哪些
    @Select("select perm_id from smbms_role_permission where role_id=#{roleId}")
    List<Integer> findPermIds(@Param("roleId") Integer roleId);

   // @Select("SELECT t1.id,t2.id AS t2id FROM smbms_user t1 JOIN smbms_role t2 ON t1.user_role=t2.`id` ")
   @Select("select user_role from smbms_user where id=#{userId}")
    List<Integer> findPermIds1(@Param("userId") Integer userId);
}
